delta=$1
num_cpus=$2
start_offset=$3

for (( process_offset=0 ; process_offset<num_cpus*delta ; process_offset+=delta ))
do

echo $process_offset  
echo "matlab -nodisplay -r pathdef; globalcntr_range=${process_offset}+${start_offset}+(1:${delta}); run_multiple ; exit"

nice matlab -nodisplay -r "pathdef; globalcntr_range=${process_offset}+${start_offset}+(1:${delta}); run_multiple ; exit" &
sleep 1
done
